/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="seller")
public class Seller implements Serializable {
	public Seller() {
	}
	
	private int id;
	
	private String code;
	
	private String name;
	
	private String contacts;
	
	private String telPhone;
	
	private String mobPhone;
	
	private String address;
	
	private java.util.Date createdAt;
	
	private java.util.Date updatedAt;
	
	private java.util.Set goodsOrder = new java.util.HashSet();
	
	private java.util.Set storageOrder = new java.util.HashSet();
	
	private java.util.Set goods = new java.util.HashSet();
	
	private java.util.Set storage = new java.util.HashSet();
	
	private java.util.Set user_seller = new java.util.HashSet();
	
	private java.util.Set express = new java.util.HashSet();
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_SELLER_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_SELLER_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	/**
	 * 商家编码
	 */
	public void setCode(String value) {
		this.code = value;
	}
	
	/**
	 * 商家编码
	 */
	@Column(name="code", nullable=true, length=255)	
	public String getCode() {
		return code;
	}
	
	/**
	 * 商家名称
	 */
	public void setName(String value) {
		this.name = value;
	}
	
	/**
	 * 商家名称
	 */
	@Column(name="name", nullable=true, length=255)	
	public String getName() {
		return name;
	}
	
	/**
	 * 联系人
	 */
	public void setContacts(String value) {
		this.contacts = value;
	}
	
	/**
	 * 联系人
	 */
	@Column(name="contacts", nullable=true, length=255)	
	public String getContacts() {
		return contacts;
	}
	
	/**
	 * 公司电话
	 */
	public void setTelPhone(String value) {
		this.telPhone = value;
	}
	
	/**
	 * 公司电话
	 */
	@Column(name="telPhone", nullable=true, length=255)	
	public String getTelPhone() {
		return telPhone;
	}
	
	/**
	 * 手机
	 */
	public void setMobPhone(String value) {
		this.mobPhone = value;
	}
	
	/**
	 * 手机
	 */
	@Column(name="mobPhone", nullable=true, length=255)	
	public String getMobPhone() {
		return mobPhone;
	}
	
	/**
	 * 地址
	 */
	public void setAddress(String value) {
		this.address = value;
	}
	
	/**
	 * 地址
	 */
	@Column(name="address", nullable=true, length=255)	
	public String getAddress() {
		return address;
	}
	
	/**
	 * 添加时间
	 */
	public void setCreatedAt(java.util.Date value) {
		this.createdAt = value;
	}
	
	/**
	 * 添加时间
	 */
	@Column(name="createdAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getCreatedAt() {
		return createdAt;
	}
	
	/**
	 * 更新时间
	 */
	public void setUpdatedAt(java.util.Date value) {
		this.updatedAt = value;
	}
	
	/**
	 * 更新时间
	 */
	@Column(name="updatedAt", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getUpdatedAt() {
		return updatedAt;
	}
	
	public void setGoodsOrder(java.util.Set value) {
		this.goodsOrder = value;
	}
	
	@OneToMany(mappedBy="seller", targetEntity=cn.imvc.app.entities.GoodsOrder.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getGoodsOrder() {
		return goodsOrder;
	}
	
	
	public void setStorageOrder(java.util.Set value) {
		this.storageOrder = value;
	}
	
	@OneToMany(mappedBy="seller", targetEntity=cn.imvc.app.entities.StorageOrder.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getStorageOrder() {
		return storageOrder;
	}
	
	
	public void setGoods(java.util.Set value) {
		this.goods = value;
	}
	
	@OneToMany(mappedBy="seller", targetEntity=cn.imvc.app.entities.Goods.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getGoods() {
		return goods;
	}
	
	
	public void setStorage(java.util.Set value) {
		this.storage = value;
	}
	
	@OneToMany(mappedBy="seller", targetEntity=cn.imvc.app.entities.Storage.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getStorage() {
		return storage;
	}
	
	
	public void setUser_seller(java.util.Set value) {
		this.user_seller = value;
	}
	
	@OneToMany(mappedBy="seller", targetEntity=cn.imvc.app.entities.UserSeller.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getUser_seller() {
		return user_seller;
	}
	
	
	public void setExpress(java.util.Set value) {
		this.express = value;
	}
	
	@OneToMany(mappedBy="seller", targetEntity=cn.imvc.app.entities.Express.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getExpress() {
		return express;
	}
	
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("Seller[ ");
			sb.append("Id=").append(getId()).append(" ");
			sb.append("Code=").append(getCode()).append(" ");
			sb.append("Name=").append(getName()).append(" ");
			sb.append("Contacts=").append(getContacts()).append(" ");
			sb.append("TelPhone=").append(getTelPhone()).append(" ");
			sb.append("MobPhone=").append(getMobPhone()).append(" ");
			sb.append("Address=").append(getAddress()).append(" ");
			sb.append("CreatedAt=").append(getCreatedAt()).append(" ");
			sb.append("UpdatedAt=").append(getUpdatedAt()).append(" ");
			sb.append("GoodsOrder.size=").append(getGoodsOrder().size()).append(" ");
			sb.append("StorageOrder.size=").append(getStorageOrder().size()).append(" ");
			sb.append("Goods.size=").append(getGoods().size()).append(" ");
			sb.append("Storage.size=").append(getStorage().size()).append(" ");
			sb.append("User_seller.size=").append(getUser_seller().size()).append(" ");
			sb.append("Express.size=").append(getExpress().size()).append(" ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
